package com.software.levelupserver.exception;

import com.software.levelupserver.utils.ResultVOUtil;
import com.software.levelupserver.vo.Result;
import org.springframework.mail.MailSendException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class BizExceptionHandler {
    @ExceptionHandler(value = {BizException.class})
    public Result handle(BizException e){
        return ResultVOUtil.error(e.getMessage());
    }
    @ExceptionHandler(value = {MailSendException.class})
    public Result handle(MailSendException e){
        return ResultVOUtil.error(e.getMessage());
    }

}
